package com.electronic.modules.revoke.param;

import com.alibaba.fastjson.JSONObject;
import com.electronic.domain.CebsSdkProperties;
import com.electronic.valid.BeanValidator;
import lombok.Data;

import javax.validation.constraints.NotNull;


/**
 * @Author: IFCA
 * @Description: 获取撤章二维码
 */

@Data
public class GenerateRevokeSignatureQRCodeDTO {


    /**
     * 文件路径 path不能为空
     */
    @NotNull(message = "文件地址不能为空")
    private String path;

    /**
     * 初始化CA信息
     */
    @NotNull(message = "初始化CA信息不能为空")
    private CebsSdkProperties cebsSdkProperties;


    public static GenerateRevokeSignatureQRCodeDTO parse(String businessData){
        GenerateRevokeSignatureQRCodeDTO dto = JSONObject.parseObject(businessData, GenerateRevokeSignatureQRCodeDTO.class);
        //验证必填项
        BeanValidator.validateReturnException(dto);
        return dto;
    }
}
